<%@ Control Language="C#" AutoEventWireup="true" CodeFile="BookingList.ascx.cs" Inherits="admin_BookingList" %>
<script type="text/javascript">
    var the_url = "";
    function get_text() {
        the_url ="Default.aspx?ctrl=booking_list&search="+ document.getElementById("txtSearch").value;
    }
</script>
<table>
    <tr>
        <td style="width: 139px">
            Enter text to search:</td>
        <td style="width: 100px">
            <input id="txtSearch"  type="text" /></td>
        <td style="width: 100px">
        <a class="c_button" onclick="get_text();" href="javascript:location=the_url">Search</a>
        </td>
    </tr>
</table>
List of booking<br />
<br />
<asp:GridView CssClass="list_table" ID="dgrBooking" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" OnRowDeleting="dgrBooking_RowDeleting">
    <Columns>
        <asp:TemplateField HeaderText="Customer">            
            <ItemTemplate>
                <%# Eval("FirstName") %> <%#Eval("LastName") %>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Type">           
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%#GetType(Eval("Type")) %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Booking date">          
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Bind("ModifiedDate","{0: MMM, dd yyyy}") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="State">            
            <ItemTemplate>
                <asp:Label ID="Label4" runat="server" Text='<%# GetState(Eval("State")) %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:TemplateField>
            <EditItemTemplate>
                <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <a href="Default.aspx?ctrl=booking_det&mode=<%#Eval("Type") %>&id=<%#Eval("ID") %>&search=<%=GetSearchRequest() %>">Edit</a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:CommandField ShowDeleteButton="True" />
    </Columns>
</asp:GridView>
<asp:Label ID="lblPaging" runat="server"></asp:Label>
<script type="text/javascript" language="javascript">    
	window.location.hash="<%=ActiveAccording %>";
</script>